# app/models/spot_model.py
from sqlalchemy import Column, BigInteger, String, DateTime, Text, Boolean
from sqlalchemy.sql import func
from app.db.database import Base

class Spot(Base):
    __tablename__ = "spot"

    id          = Column(BigInteger, primary_key=True, autoincrement=True, index=True)
    name        = Column(String(128), nullable=False, comment="景点名称")
    city        = Column(String(64),  nullable=False, comment="所在城市")
    description = Column(Text, comment="图文详情")
    cover_url   = Column(String(255), comment="封面图地址")
    lng         = Column(String(32), comment="经度")
    lat         = Column(String(32), comment="纬度")
    is_deleted  = Column(Boolean, default=False, comment="软删标记")
    created_at  = Column(DateTime, server_default=func.now())
    updated_at  = Column(DateTime, server_default=func.now(), onupdate=func.now())